<?php
	$model = new Model_Article_Article();
	$item = $model->getItemId($this->id);
?>
<div class="box"> <!-- Box begins here -->
	<h2>Tag <span class="blue"><?php echo $item['name'];?> </span>| <a class="add" href="<?php echo $this->url(array("module"=>"administrator","controller"=>"article","action"=>"addtag","id_artice"=>$this->id),null,true); ?>">Thêm</a></h2>
	
	<?php echo $this->paginationControl($this->data,"Sliding","pagination.phtml");  ?>
<table>
	<thead>
		<tr>
			<td>Id </td>
			<td>Tên tag</td>
			<td>Thao tác</td>
		</tr>
	</thead>
	<tbody>
			<?php
				if(!empty($this->data)): 
			?>
			<?php foreach($this->data as $item): ?>
			<tr class="">
				<td><?php echo $item['id']; ?></td>
				<td><?php echo Model_Tag_Tag::getNamebyId($item['tag']); ?></td>
				<td>
					<a class="delete" href="<?php echo $this->url(array("module"=>"administrator","controller"=>"article","action"=>"removetag","id"=>$item['id']),null,true);?>">Xóa</a>
				</td>
			</tr>
		     <?php endforeach; ?>
			 	
			 		
			 		
			 <?php else :?>
			 <tr>
			 	<td>
			 	Chưa có bài viết nào nào.
				</td>
			 </tr>
			 <?php endif; ?>
			
			
			
	</tbody>
	
</table>
<?php echo $this->paginationControl($this->data,"Sliding","pagination.phtml");  ?>
</div>
<script type="text/javascript">
	$(document).ready(function(){
			$(".delete").click(function(){
				if(confirm("Ban mua xoa ?")){
					$(this).parent().parent().remove();
					$.get($(this).attr("href"));
				}
				return false;
			});
	});
</script>